package org.redis.cluster.admin.client.adapter;

import org.redis.cluster.admin.client.model.RoutingClientConfig;
import org.redis.cluster.config.ClientConfig;
import org.redis.cluster.loadbalance.slot.SlotClientConfig;

public class ClientConfigAdapter {

	/**
	 * @param config
	 * @return
	 */
	public static SlotClientConfig adaptClientConfig(ClientConfig config) {
		SlotClientConfig result=new SlotClientConfig();
		result.setId(config.getId());
		result.setClient(config.getClient());
		result.setHost(config.getHost());
		result.setPort(config.getPort());
		result.setConnection(config.getConnection());
		result.setTimeout(config.getTimeout());
		return result;
	}
	
	/**
	 * @param config
	 * @return
	 */
	public static RoutingClientConfig adaptRoutingClientConfig(ClientConfig config) {
		RoutingClientConfig result=new RoutingClientConfig();
		result.setId(config.getId());
		result.setClient(config.getClient());
		result.setHost(config.getHost());
		result.setPort(config.getPort());
		result.setConnection(config.getConnection());
		result.setTimeout(config.getTimeout());
		result.setInfo(config.getInfo());
		return result;
	}
}